package com.woniuxy04;


public class Student {
    //属性，成员变量，这个类的任何方法都可以使用
    String name;
    int age;
    String gender;
    int height;
    int weight;

    public Student(){
        System.out.println("无参构造方法");
    }


    //方法中的局部变量和成员变量重名，局部变量的优先级高于成员变量
    public Student(String name,int age,String gender,int height,int weight){
        System.out.println("带参构造方法");
        this.name=name;
        this.age=age;
        this.gender=gender;
        this.height=height;
        this.weight=weight;
    }

//    public void Student(){
//        System.out.println("这不是构造方法，这是普通方法");
//    }

    public String showInfo(){
        return "name:"+name+",age="+age+",gender="+gender+",height="+height+
                ",weight="+this.weight;
    }
}
